package com.ln.dm1104.demo03;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Stream;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/4 16:43
 */
public class Test02 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list, "张无忌", "周芷若", "赵敏", "张强", "张三丰");
        //通过集合对象调用stream方法获取
        Stream<String> stream = list.stream();
        //通过Arrays数组工具类调用stream方法
        String[] arr={"你","好","世","界"};
        Stream<String> stream1 = Arrays.stream(arr);
        //通过Stream类中的方法获取stream流对象
        Stream<String> stream2 = Stream.of("你", "好", "世", "界");
    }
}
